package timing.ukulele.third.controller.msg;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import timing.ukulele.common.data.ResponseData;
import timing.ukulele.data.third.data.msg.MessageKeyMappingFiledDTO;
import timing.ukulele.data.third.view.msg.MessageKeyMappingFiledVO;
import timing.ukulele.third.service.msg.MessageKeyMappingFiledService;
import java.util.List;

/**
 * 消息参数字段映射管理Controller
 *
 * @author zh
 */
@Slf4j
@RestController
@RequestMapping("/msg/messageKeyMappingFiled")
public class MessageKeyMappingFiledController {

    private final MessageKeyMappingFiledService service;

    public MessageKeyMappingFiledController(MessageKeyMappingFiledService service) {
        this.service = service;
    }

    /**
     * /msg/messageKeyMappingFiled/page
     * @param dto
     * @return
     */
    @Operation(summary = "分页查询")
    @GetMapping("/page")
    public ResponseData<IPage<MessageKeyMappingFiledVO>> pageList(MessageKeyMappingFiledDTO dto) {
        return ResponseData.success(service.pageList(dto));
    }

    /**
     * /msg/messageKeyMappingFiled/getAllList
     * @return
     */
    @Operation(summary = "获取全部列表")
    @GetMapping("/getAllList")
    public ResponseData<List<MessageKeyMappingFiledVO>> getAllList() {
        return ResponseData.success(service.getAllList());
    }

}

